<template>
  <view
    class="content"
    :style="{
      'padding-top': height + 'px',
    }"
  >
    <view
      :style="{
        height: statusBarHeight + 'px',
      }"
    >
    </view>

    <view
      class="head"
      :style="{
        top: statusBarHeight + 'px',
      }"
    >
      <view class="head_left">
        <u-icon
          name="arrow-left"
          color="#444"
          size="24"
          :bold="true"
          @click="toBack"
        ></u-icon>
      </view>
      <view class="text">飞离洞</view>
    </view>
    <view class="boxs">
      <Fly :list="list"></Fly>
	  <view class="empty_view" v-if="list && list.length == 0">
	  	<image class="item_left_clickable" src="../../static/images/my/kong.png" mode=""></image>
	  	<view>当前暂无内容~</view>
	  </view>
    </view>

    <floatingBall></floatingBall>
  </view>
</template>

<script>
import Fly from "@/components/search/Fly.vue"; //飞离洞

export default {
  components: {
    Fly,
  },
  data() {
    return {
      statusBarHeight: 0,
      height: 0,
	  list:[]
    };
  },
  onLoad(options) {
    this.id = options.id;
  },
  created() {
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度

    this.statusBarHeight = statusBarHeight.statusBarHeight;
    this.$nextTick(() => {
      uni
        .createSelectorQuery()
        .select(".head")
        .boundingClientRect((data) => {
          this.height = data.height;
        })
        .exec();
    });
	this.getList()
  },
  methods: {
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    getList() {
      this.$http
        .renwuzhiFeilidong({ id: this.id })
        .then((res) => {
          this.list = res.data.list.data;
          console.log(this.list, "人物飞离洞列表");
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
  },
};
</script>

<style scoped lang="scss">
.content {
  box-sizing: border-box;
}
.head {
  width: 100%;
  padding: 18rpx 30rpx 47rpx;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 99;
  background: #fff;

  .head_left {
    position: absolute;
    left: 30rpx;
  }

  .text {
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #444444;
  }
}
.boxs {
  width: 100%;
  padding: 0 30rpx;
  box-sizing: border-box;
}
.empty_view {
		margin-top: 100rpx;
		padding-bottom: 120rpx;

		image {
			margin: 0 auto;
			width: 410rpx;
			height: 410rpx;
		}

		view {
			font-size: 30rpx;
			color: #d8d8d8;
			text-align: center;
		}
	}
</style>